package com.yidu.drug.dao;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.yidu.drug.model.FdPurchaseModel;

public interface FdPurchaseModelMapper {
	
	//删除
    int deleteByPrimaryKey(String fdPoId);

    int insert(FdPurchaseModel record);

    //新增订单
    int insertSelective(FdPurchaseModel record);
    
    FdPurchaseModel selectByPrimaryKey(String fdPoId);
    
    //根据id修改订单
    int updateByPrimaryKeySelective(FdPurchaseModel record);

    int updateByPrimaryKey(FdPurchaseModel record);
    
    //查询订单表中的所有订单
    public List<FdPurchaseModel> findAll(@Param("fdPurchaseModel")FdPurchaseModel fdPurchaseModel,@Param("page")int page,@Param("limit")int limit);
    
    /**
     * 分页·查询
     * @param fdPurchaseModel
     * @return
     */
    int findRows(FdPurchaseModel fdPurchaseModel);
    /**
     * 根据id修改价格和数量
     * @param fdSunnum
     * @param fdSumprice
     * @param fdPoId
     * @return
     */
    int updates(@Param("fdSunnum")Long fdSunnum,@Param("fdSumprice")BigDecimal fdSumprice,@Param("fdPoId")String fdPoId);

	List<FdPurchaseModel> findAllPage(Map<String,String> paramMap);
	
	/**
     * 分页查询和条件查询
     * @param paramMap
     * @return
     */
	List<FdPurchaseModel> findAllPages(Map<String,String> paramMap);
	/**
	 * 分页
	 * @param fdPurchaseModel
	 * @return
	 */
	int findTotalRows(Map<String, String> map);
	
	/**
     * 采购订单审核分页查询和条件查询
     * @param paramMap
     * @return
     */
	List<FdPurchaseModel> findAllshenhe(Map<String,String> paramMap);
	/**
	 * 采购订单审核分页
	 * @param fdPurchaseModel
	 * @return
	 */
	int findAllshenheRows(Map<String, String> map);
	
	 /**
     * 修改审核状态
     * @param fdPoId
     * @return
     */
	int updateFdPoState(@Param("fdPoId")String fdPoId,@Param("fdPoState")String fdPoState);

	  int findRowss(FdPurchaseModel fdPurchase);

	List<FdPurchaseModel> findAllPagess(Map<String, String> map);

	FdPurchaseModel findByfdPoId(String fdPoId);

	List<FdPurchaseModel> findZdCwAll(Map<String, String> map);

	int findZdCwRow(FdPurchaseModel fdPurchase);
	/**
	 * 采购显示所有--退货
	 * @param map
	 * @return
	 */
	List<FdPurchaseModel> findAlls(Map<String, String> map);
	/**
	 * 采购显示所有--退货
	 * @param map
	 * @return
	 */
	Object findRows(Map<String, String> map);

	/**
	 * 根据采购Id修改审核状态(重新审核)
	 * @param fdPoId
	 * @return
	 */
	int updateByFdPoId(String fdPoId);
}